Chats = new Mongo.Collection('chats');
Messages = new Mongo.Collection('messages');
//内置可选选项
DefaultOptions = new Mongo.Collection('default_options');
//公司信息
Companies = new Mongo.Collection('companies');

//员工账号 TODO
Employees = new Mongo.Collection('employees');

//店铺管理
Departments = new Mongo.Collection('departments');

//商品分类
ProductCatalogs = new Mongo.Collection('product_catalogs');

ProductPropertyGroups = new Mongo.Collection('product_property_groups');

//商品管理
Products = new Mongo.Collection('products');

//销售单
SaleOrders = new Mongo.Collection('sale_orders');

//实时库存概况
Inventory = new Mongo.Collection('inventory');
//入库单
StockInOrders = new Mongo.Collection('stock_in_orders');
//出库单
StockOutOrders = new Mongo.Collection('stock_out_orders');
//库存调拨
StockTransfer = new Mongo.Collection('stock_transfer');
//库存盘点单
StockInventory  = new Mongo.Collection('stock_inventory');
// ProductBrands  = new Mongo.Collection('product_brands');
// 供应商
Suppliers = new Mongo.Collection('suppliers');

Purchase = new Mongo.Collection('purchase');

Meteor.users.allow({
  insert: function (userId, users) {
    return userId;
  },
  update: function (userId) {  //, party, fields, modifier
    return userId;  // && party.owner === userId
  },
  remove: function (userId) {
    return userId;
  }
});

Chats.allow({
  insert: function (userId, users) {
    return userId;
  },
  update: function (userId) {  //, party, fields, modifier
    return userId;  // && party.owner === userId
  },
  remove: function (userId) {
    return userId;
  }
});
